		TITLE	PROLOG	 -

		INCLUDE	MACROS

		PUBLIC	PERFORM_VERIFY

		.DATA

	SOFT	EXTB	SYMBOL_TPTR

	SOFT	EXTW	SYMBOL_LENGTH

	SOFT	EXTCA	OPTI_MOVE

		.CODE	MIDDLE_TEXT

	SOFT	EXTP	FAR_INSTALL,SEARCH_RAINBOW_AXBX,ERR_ABORT,LNAME_INSTALL

	SOFT	EXTA	CANNOT_LINK_ERR

		ASSUME	DS:NOTHING

PERFORM_VERIFY	PROC
		;
		;LOOK FOR CLASSES OF PROSYMB, PROMOD
		;
		;ALSO SYMBOL _PROLOG_SymbolTable MUST BE DEFINED
		;
		LEA	SI,PROSYMB
		CALL	VERIFY_CLASS
		LEA	SI,PROMOD
		CALL	VERIFY_CLASS
		LEA	SI,_PROLOG_SymbolTable
		CALL	VERIFY_SYMBOL
		RET

PERFORM_VERIFY	ENDP

VERIFY_CLASS	PROC	NEAR
		;
		;
		;
		PUSH	CS
		POP	DS
		CALL	UNXOR
		FIXES
		GET_NAME_HASH
		CALL	LNAME_INSTALL
;		MOV	CX,RECTYP_CLASS
		CALL	SEARCH_RAINBOW_AXBX
		JC	VERIFY_FAIL
		RET

VERIFY_CLASS	ENDP

VERIFY_FAIL:
		MOV	CL,CANNOT_LINK_ERR
		CALL	ERR_ABORT

VERIFY_SYMBOL	PROC	NEAR
		;
		;
		;
		PUSH	CS
		POP	DS
		CALL	UNXOR
		FIXES
		GET_NAME_HASH
		CALL	FAR_INSTALL
		JNC	VERIFY_FAIL
		RET

VERIFY_SYMBOL	ENDP

UNXOR		PROC	NEAR
		;
		;
		;
		PUSH	SI
		MOV	AH,0AAH
		XOR	BPTR [SI],AH
		LODSB
		MOV	CL,AL
		XOR	CH,CH
1$:
		XOR	BPTR [SI],AH
		INC	SI
		LOOP	1$
		POP	SI
		RET

UNXOR		ENDP

GENSTRING	MACRO	XX
		LOCAL	LEN

XX		DB	LEN XOR 0AAH
		IRPC	XXX,<XX>
		DB	'&XXX' XOR 0AAH
		ENDM

LEN		EQU	$-1-XX

		ENDM

		GENSTRING	PROSYMB
		GENSTRING	PROMOD
		GENSTRING	_PROLOG_SymbolTable

		END

